<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nickname')->index()->default('')->comment('昵称');
            $table->string('sex')->default('1')->comment('性别：1、男；2、女');
            $table->text('avatar')->comment('头像');
            $table->string('sign')->nullable()->comment('个性签名');
            $table->string('open_id')->unique()->default('')->comment('open_id');
            $table->string('session_key')->default('')->comment('session_key');
            $table->integer('comment_count')->default('0')->nullable()->comment('评论数');
            $table->integer('favs_count')->default('0')->nullable()->comment('点赞数');
            $table->integer('relay_count')->default('0')->nullable()->comment('转发数');
            $table->tinyInteger('status')->default('1')->nullable()->comment('状态：1、正常；0、冻结');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('members');
    }
}
